Repository navigation
fix(mcpx): reject non-positive ticker intervals in settings validation (#3467) - #4220
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5bafd5572
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Fixes #3467 (task 5402).
Three
KindDurationsettings are passed directly totime.NewTicker—daemon.reapIntervalanddaemon.saveInterval(daemon/server.go:583,585) andhttp.ssePing(daemon/server.go:1563) — andtime.NewTickerpanics on a non-positive period. Settings validation accepted zero and negative durations for them, so an explicit0s/-5sin config crashed the daemon at startup or an SSE handler later.internal/settings/value.go: in the sharedValidateparser, refused <= 0for exactly the three ticker paths (tickerIntervalSettings), with a setting-named error. Positivity stays per-setting, not blanket:daemon.idleExit=0s("never") stays valid, andartifacts.gcInterval/transport.sseKeepAlivekeep accepting zero because their readers fall back to a default.internal/settings/tickerinterval_test.go(new): registry-backed tests refusing0s/-5s/0/-1nsfor all three settings, accepting positive values and defaults, keepingdaemon.idleExit=0svalid, and keeping the guarded-fallback durations at zero valid.Verification on the laptop:
go test ./internal/daemon— ok.go test ./internal/settingshas 5 failing tests (TestEveryDocumentHasAChapter, TestNoUndeclaredEnvRead, TestEverySettingHasAnEffectProbeOrAnExemption, TestTheScriptEnvironmentIsWhatTheCodeSets, TestTheEnvironmentDocIsCurrent) — verified identical on clean main 591bde9 with this change stashed, so they are pre-existing on main and untouched by this PR.Need help on this PR? Tag
@codesmith-botwith what you need.